
<script>
	// 数据详情页
	import {
		defineComponent
	} from 'vue'
	export default defineComponent({
		name: 'WeworkQrList'
	})
</script>
<script setup>
import Set from './data/set.vue'
import Chart from './data/chart.vue'
import Table from './data/table.vue'
import { ref } from 'vue'
import { reqQrList } from '@/api'

const set = ref(null)
const chart = ref(null)
const table = ref(null)
const qrList = ref([])
const getOption = async()=>{
		const r = await reqQrList({
			page:1,
			size:9999
		})
	qrList.value = r.data.item
}
const qrIds = ref([])
getOption()

const show = (id)=>{
	if(id) qrIds.value.push(id)
	console.log(id,'yuiyuiyui')
	setTimeout(()=>{
			if(id) {
				set.value.show([id])
				chart.value.show([id])
				table.value.show([id])
			}else{ 
				set.value.show([])
				chart.value.show([])
				table.value.show([])
			}
		
	},5)
	
}
const changeQr1 = ()=>{
	set.value.show(qrIds.value)
	chart.value.show(qrIds.value)
	table.value.show(qrIds.value)
}
defineExpose({
	show
})

</script>

<template>
<div style="margin-left: 40px;" class="app-gap-block-top">
		<span class="app-select-right">渠道码：</span>
		<el-select multiple v-model="qrIds" @change="changeQr1" class="m-2" placeholder="请选择" size="large">
					<el-option
						v-for="(item,index) in qrList"
						:key="index"
						:label="item.name"
						:value="item.id"
					/>
		</el-select>
</div>
<Set ref="set" />
<Chart ref="chart" />
<Table ref="table" />


</template>
<style lang="scss">
</style>